/*
 * @Author: wuzhouhai wzh200x@126.com
 * @Date: 2024-05-16 11:18:28
 * @LastEditors: wuzhouhai wzh200x@126.com
 * @LastEditTime: 2024-07-10 14:34:53
 * @FilePath: \dwys_web\extensions\phoenix-plugin-client\assets\core\net\message\message.ts
 * @Description: 
 */
import { Opcode } from "../../defines/opcode.define";
import { IMessage } from "../../interface/iMessage";
export class BaseMessage implements IMessage {
    opcode: number;
    messageEntity: any;
    
    constructor(opcode: number) {
        this.opcode = opcode;
    }
    
    CheckIsS2C(): boolean {
        return this.opcode > Opcode.Opcode_SC_START;
    }

    Decode(data: Uint8Array): void {

    }
    
    Encode(): Uint8Array {
        return new Uint8Array(0);
    }

    public GetOpcode():number {
        return this.opcode;
    }

    public GetMessageEntity<T>():T {
        return this.messageEntity as T;
    }
}